//
//  PersonalCenterViewModel.swift
//  OnceNectar
//
//  Created by yanghao on 09/05/2018.
//  Copyright © 2018 com.inwhoop. All rights reserved.
//

import Foundation
import Alamofire

class PersonalCenterViewModel {
    
    var requestUrl:String
    
    var parameters:[String: Any]?
    
    var isLoadMore: Bool = false
    
    private var models: [ConsultaionModel] = Array()
    
    init(requestUrl:String, parameters:[String: Any]?) {
        self.requestUrl = requestUrl
        self.parameters = parameters
    }
    
    //注册
    func register() -> Void {
//        let netWorking = Networking(baseURL: BaseURL)
//        netWorking.post(requestUrl, parameters:parameters) {
//            
//
//            result in
//            switch result {
//            case .success(let response):
//                let json = response.dictionaryBody
//            //                complete(analysisData(json), self.isLoadMore)
//            case .failure(let response): break
//                //                errorRequest(response, self.isLoadMore)
//            }
//        }
        
    }
    //获取验证码
    func getCode() -> Void {

        Alamofire.request("http://www.1du.me/miwebproj/api/article/3", method: .get, parameters: nil, encoding: URLEncoding.default, headers: nil).responseJSON { (response) in
            if(response.error == nil){
                print("请求成功")
                
            }else{
                print("请求失败\(String(describing: response.error))")
            }
            
        }

    
    }
}
